<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2025/7/15
  Time: 14:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    // 会话ID
    String id = session.getId();
    // 是否是新会话
    boolean isNew = session.isNew();
    // 第一次请求的时间
    long creationTime = session.getCreationTime();
    // 最后一次请求的时间
    long lastAccessedTime = session.getLastAccessedTime();
    // 最大存活时间
    long maxInactiveInterval = session.getMaxInactiveInterval();
    // 设置最大存活时间
    session.setMaxInactiveInterval(1800);
    // 让当前会话失效
    // session.invalidate();
    out.print("id:" + id + "<br/>");
    out.print("isNew:" + isNew + "<br/>");
    out.print("creationTime:" + creationTime + "<br/>");
    out.print("lastAccessedTime:" + lastAccessedTime + "<br/>");
    out.print("maxInactiveInterval:" + maxInactiveInterval + "<br/>");
%>
</body>
</html>
